<?php

declare(strict_types=1);

namespace App\Bac\Request\RBAC;

use Hyperf\Validation\Request\FormRequest;

class MenuRequest extends FormRequest
{
    protected array $scenes = [
        'add' => ['permission_id','name','url','parent_id'],
        'edit' => ['id','permission_id','name','url','parent_id'],
    ];
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'id' => "required|integer",
            'permission_id' => "present",
            'url' => "required|string",
            'name' => "required|string",
            'parent_id' => "present",
        ];
    }
}
